<?php
$this->breadcrumbs = array(
    'Gallery' => array('index'),
    'Manage',
);

$this->menu = array(
    array('label' => 'Create Gallery', 'url' => array('create')),
);
?>

<h1>Manage Galleries</h1>

<?php $grid = $this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'term-grid',
    'dataProvider' => $model->search(),
    'filter' => $model,
    'selectableRows' => 2,
    'selectionChanged' => "updateSelectors",
    'columns' => array(
        array(
            'class' => 'CCheckBoxColumn',
            'value' => '$data->id',
            'htmlOptions' => array('width' => '3%'),
        ),
        'name',
        'alias',
        array(
            'class' => 'CButtonColumn',
            'template' => '{update} {delete}'
        ),
    ),
));

if ($grid->dataProvider->ItemCount) {
    $this->menu[] = array('label' => 'Delete selected items', 'url' => $this->createUrl('delete'), 'linkOptions' => array('onclick' => 'return multipleDelete("term-grid",this.href)'));
}
Yii::app()->clientScript->registerScriptFile(Yii::app()->core->AssetUrl . '/scripts/gridview.js', CClientScript::POS_BEGIN);
?>
